import request from '@/config/axios'

export interface UserVO {
  memberShip: any //是否付费会员
  memberPicUrl: any //付费会员图片路径
  arrearsPrice: string | number
  balance: any
  ppcNum: any
  ppcBalance: any
  employee: any
  activeDays: any
  tenantName: any
  couponNum: any
  targetWeight: number
  id: number
  avatar: string | undefined
  birthday: number | undefined
  createTime: number | undefined
  loginDate: number | undefined
  loginIp: string
  mark: string
  mobile: string
  name: string | undefined
  nickname: string | undefined
  registerIp: string
  sex: number
  status: number
  areaId: number | undefined
  areaName: string | undefined
  levelName: string | null
  point: number | undefined | null
  totalPoint: number | undefined | null
  experience: number | null | undefined
  weight: number
  height: number
  isLunar: number //生日是否农历 0 否 1 是,示例值(1)
  employeeId: number //所属员工ID,
}

// 查询会员用户列表
export const getUserPage = async (params) => {
  return await request.get({ url: `/member/user/page`, params })
}

// 查询会员用户详情
export const getUser = async (id: number) => {
  return await request.get({ url: `/member/user/get?id=` + id })
}
// 创建会员用户
export const createUser = async (data: UserVO) => {
  return await request.put({ url: `/member/user/create`, data })
}

// 修改会员用户
export const updateUser = async (data: UserVO) => {
  return await request.put({ url: `/member/user/update`, data })
}

// 修改会员用户等级
export const updateUserLevel = async (data: any) => {
  return await request.put({ url: `/member/user/update-level`, data })
}

// 修改会员用户积分
export const updateUserPoint = async (data: any) => {
  return await request.put({ url: `/member/user/update-point`, data })
}
